package com.lhl.config;

import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;

/**
 * @author hanLin.liu
 * @create 2024-10-11 14:07
 */
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {

    // 定制授权规则
    @Override
    protected void configure(HttpSecurity http) throws Exception{
        // 允许匿名访问路径
        http.antMatcher("/login")
                .anonymous().and();
    }

    // 定制认证规则
    @Override
    protected void configure(AuthenticationManagerBuilder auth) throws Exception {

    }
}
